#ifndef TEXTUREMANAGER_H_INCLUDED
#define TEXTUREMANAGER_H_INCLUDED

#include "resources/resourcemanager.h"
#include "resources/textureresource.h"
#include "core/logger.h"

namespace engine {

	namespace resources {
			
		using engine::Logger;
		
		class TextureManager : public ResourceManager<TextureResource> {
			private:
			
			public:
				TextureManager() {
					
				}
				
				virtual ~TextureManager() {
					
				}
				
				bool loadResourceFromFile(const string& name, const string& filename) {
					shared_ptr<TextureResource> newTex(new TextureResource());
					if (!newTex->LoadTextureFile(filename)) {
						Logger::getLogger("texturemanager")->error("Could not load: " + filename);
						Logger::getLogger("texturemanager")->error(" -Reason: " + newTex->GetErrorString());
						return false;
					}
					
					glEnable(GL_TEXTURE_2D);
					newTex->BuildTexture();
					m_Resources.insert(make_pair(name, newTex));
					return true;
				}
				
				bool loadResourceFromMemory(const string& name, const char* memory) {
					return true;
				}
		};
	}
}

#endif // TEXTUREMANAGER_H_INCLUDED
